﻿using PAP.Domain.UserAccount.Entities;
using PAP.Domain.UserAccount.Repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NHibernate.Linq;
using PAP.Application.Core;

namespace PAP.Infrastructure.DataAccess.NH.Domain.Repositories
{
    public sealed class UserRepository : RepositoryBase<User>, IUserRepository
    {
        #region "Constructors"
        public UserRepository(IUnitOfWork unitOfWork)
            : base(unitOfWork)
        { }
        #endregion
        public User GetByLogin(string login)
        {
            return Session.Query<User>()
                .SingleOrDefault(x => x.Login.Equals(login));
        }
    }
}
